Skip to content

Linux hot reload: opt-in linux-debug-hotreload preset, glue, and vendored loader - #2097

Open
sunmachine wants to merge 4 commits into
NeotokyoRebuild:masterfrom
sunmachine:hot-reload-linux
Open

Linux hot reload: opt-in linux-debug-hotreload preset, glue, and vendored loader#2097
sunmachine wants to merge 4 commits into
NeotokyoRebuild:masterfrom
sunmachine:hot-reload-linux

Conversation

@sunmachine

@sunmachine sunmachine commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Description

Opt-in hot reload for Linux Debug builds: edit a .cpp while the game runs, save, and the rebuilt translation unit is applied to the live process in a few seconds. Nothing changes for the existing presets; every edit to game code is under NEO_LINUX_HOT_RELOAD, defined only by the new linux-debug-hotreload preset.

The loader core under src/game/shared/neo/hotreload/vendor/ is copied from ntre-build-hot-reloader at 8587f7d by its scripts/vendor.sh; VENDORED.md names the revision.

Note

Files under vendor/ are not edited here. Changes go to the reloader repo and come back through the vendor script, so review comments on that directory belong upstream.

The file watcher and compile driver (the "sidecar") live in the reloader repo and are not part of this PR; make watch-configure builds it from a checkout next to this one. Setup is the reloader's Quick start; usage is in the new README and CONTRIBUTING sections, including what hot reload does not do by design (type layout or vtable changes, datadesc/network table/prediction map edits, wide header changes are still a rebuild).

The root Makefile and src/Makefile are convenience aliases over the CMake presets only; cmake --preset / cmake --build --preset remain the supported build path.

Toolchain

  • Linux GCC 10 Sniper 3.0

Linked Issues

Opt-in, Linux Debug only. It builds both game modules so a rebuilt translation
unit can link against the live process: default visibility with -Bsymbolic,
16-byte function alignment, no gnu_unique symbols. The SDK's prebuilt archives
are hidden-visibility, so the preset links against visibility-promoted copies;
nothing under lib/ changes. make build and make watch run the toolchain in the
build container and record the applied preset.
neo_hot_reload.cpp wraps the loader with sv_/cl_ ConVars, console output and
the fixups a shim's static constructors need: duplicate ConVar and ConCommand
registrations are pruned (scoped to this module's cvars), the
ServerClass/ClientClass chain is rebuilt from a pre-apply snapshot,
InstallFactory keeps the original entity factories, and
NextBotManager::sInstance is restored. All edits to existing game code are
under NEO_LINUX_HOT_RELOAD, defined only by the linux-debug-hotreload preset.
Copied from ntre-build-hot-reloader with its scripts/vendor.sh; VENDORED.md
names the revision. Not edited here: changes go upstream and come back
through the script.
@sunmachine
sunmachine marked this pull request as draft August 27, 2026 03:19
@sunmachine

sunmachine commented Aug 27, 2026

Copy link
Copy Markdown
Contributor Author

Oops, missing a dep. Uno momento. No fix required, I'm just tired and missed a CLI command while doing another test. G'night.

@sunmachine
sunmachine marked this pull request as ready for review August 27, 2026 03:29
README and CONTRIBUTING link the ntre-build-hot-reloader Quick start for the
checkout, Rust toolchain and sniper image steps instead of restating them,
and CONTRIBUTING gains a short troubleshooting list for make watch-configure.
@sunmachine sunmachine added the Tooling Tooling related works (EX: OS fixes, libraries) label Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Tooling Tooling related works (EX: OS fixes, libraries)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant